package com.tian.earth.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.scwang.smartrefresh.layout.SmartRefreshLayout
import com.tian.earth.R

/**
 * @author tiansongtao, Email:769001510@qq.com
 * @date 19-6-21 下午2:49
 */
class SchoolListFragment : BaseFragment(){

    lateinit var smartRefreshLayout: SmartRefreshLayout

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.fragment_main_school_list, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        smartRefreshLayout = view.findViewById(R.id.srl_school_list)
        smartRefreshLayout.setOnRefreshListener { refreshContent() }
    }

    private fun refreshContent(){
        smartRefreshLayout.layout.postDelayed({
            smartRefreshLayout.finishRefresh()
        }, 2000)
    }
}